-----------------------------------------------
-- 进入下一层地牢之前的检查，暂时只做最后一层的检查
return function()
    -- 如果不是最后一层
    if not DungeonM.isMaxLayer() then
        return true;
    end

    local specialList = {
        GRID_TYPE_FEATURE_ITEM,
        GRID_TYPE_SKY_OBJECT,
    };

    -- 如果该层是最后一层，必须拾取完所有奖励（某些指定的奖励）才允许离开
    for pos, grid in pairs(DungeonM.getCurrentDungeon()) do
        if (grid.display and grid.bonus and #grid.bonus > 0) or
           (table.indexOf(specialList, grid.type) ~= -1 and grid.state ~= GRID_STATE_DISABLE) or
           (DungeonM.query(grid.class,"dbase")["formula_appear"] ~= nil and grid.state ~= GRID_STATE_DISABLE) or
           (DungeonM.query(grid.class,"dbase")["check_bonus"] ~= nil and grid.state ~= GRID_STATE_DISABLE) then
            -- 还有
            return getLocStr("bonus_not_clear");
        end
    end

    return true;
end